Remove obsolete code to use a cached mime-type
authorFederico Mena Quintero <federico@novell.com>
Thu, 3 Sep 2009 17:09:09 +0000 (12:09 -0500)
committerBenjamin Otte <otte@gnome.org>
Thu, 15 Oct 2009 20:06:16 +0000 (22:06 +0200)
The non-standard "filechooser::mime-type" was a remnant of the recent-files code using
a hand-built GFileInfo; now we just query the file info ourselves.

Signed-off-by: Federico Mena Quintero <federico@novell.com>
gtk/gtkfilesystemmodel.c

index c66c20c692dc1f94cbda268b91510872b181e340..021f60890c57371add916681b7ea3bfe63fa26c5 100644 (file)
@@ -292,22 +292,16 @@ node_should_be_visible (GtkFileSystemModel *model, guint id)
 
   if (required & GTK_FILE_FILTER_MIME_TYPE)
     {
-      filter_info.mime_type = g_file_info_get_attribute_string (node->info, "filechooser::mime-type");
-      if (filter_info.mime_type != NULL)
-        filter_info.contains |= GTK_FILE_FILTER_MIME_TYPE;
-      else
-        {
-          const char *s = g_file_info_get_content_type (node->info);
-          if (s)
-            {
-              mime_type = g_content_type_get_mime_type (s);
-              if (mime_type)
-                {
-                  filter_info.mime_type = mime_type;
-                  filter_info.contains |= GTK_FILE_FILTER_MIME_TYPE;
-                }
-            }
-        }
+      const char *s = g_file_info_get_content_type (node->info);
+      if (s)
+       {
+         mime_type = g_content_type_get_mime_type (s);
+         if (mime_type)
+           {
+             filter_info.mime_type = mime_type;
+             filter_info.contains |= GTK_FILE_FILTER_MIME_TYPE;
+           }
+       }
     }
 
   if (required & GTK_FILE_FILTER_FILENAME)